home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / prtfrm51.zip / FRMSRC.ZIP / FDEMO07.PAS < prev    next >
Pascal/Delphi Source File  |  1996-06-20  |  3KB  |  117 lines

  1. unit Fdemo07;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   StdCtrls, Forms, DBCtrls, DB, DBGrids, Mask, DBTables, Grids, ExtCtrls,
  8.   PrnWin, Buttons, Printers, CB_Types;
  9.  
  10. type
  11.   TForm07 = class(TForm)
  12.     DBGrid1: TDBGrid;
  13.     DBNavigator: TDBNavigator;
  14.     Panel1: TPanel;
  15.     DataSource1: TDataSource;
  16.     Panel2: TPanel;
  17.     Panel3: TPanel;
  18.     Table1: TTable;
  19.     Table2: TTable;
  20.     DataSource2: TDataSource;
  21.     ScrollBox: TScrollBox;
  22.     Label1: TLabel;
  23.     Label2: TLabel;
  24.     Label3: TLabel;
  25.     Label4: TLabel;
  26.     Label5: TLabel;
  27.     Label6: TLabel;
  28.     Label7: TLabel;
  29.     EditCustNo: TDBEdit;
  30.     EditCompany: TDBEdit;
  31.     EditAddr: TDBEdit;
  32.     EditAddr2: TDBEdit;
  33.     EditCity: TDBEdit;
  34.     EditState: TDBEdit;
  35.     EditZip: TDBEdit;
  36.     Preview: TBitBtn;
  37.     Label9: TLabel;
  38.     Table2OrderNo: TFloatField;
  39.     Table2CustNo: TFloatField;
  40.     Table2SaleDate: TDateTimeField;
  41.     Table2ShipDate: TDateTimeField;
  42.     Table2ShipVIA: TStringField;
  43.     Table2Terms: TStringField;
  44.     Table2PaymentMethod: TStringField;
  45.     Table2ItemsTotal: TCurrencyField;
  46.     Table2AmountPaid: TCurrencyField;
  47.     Exit: TBitBtn;
  48.     PrintWin1: TPrintWin;
  49.     DBNavigator1: TDBNavigator;
  50.     GroupBox1: TGroupBox;
  51.     Label8: TLabel;
  52.     CheckBox1: TCheckBox;
  53.     RadioButton1: TRadioButton;
  54.     RadioButton2: TRadioButton;
  55.     RadioGroup1: TRadioGroup;
  56.     RadioButton3: TRadioButton;
  57.     RadioButton4: TRadioButton;
  58.     procedure FormCreate(Sender: TObject);
  59.     procedure PreviewClick(Sender: TObject);
  60.     procedure ExitClick(Sender: TObject);
  61.   private
  62.     { private declarations }
  63.   public
  64.   end;
  65.  
  66. var
  67.   Form07: TForm07;
  68.  
  69. implementation
  70.  
  71. {$R *.DFM}
  72.  
  73. procedure TForm07.FormCreate(Sender: TObject);
  74. begin
  75.   Table1.Open;
  76.   Table2.Open;
  77. end;
  78.  
  79. procedure TForm07.PreviewClick(Sender: TObject);
  80. var
  81.     y: Real;
  82. begin
  83.    PrintWin1.BeginPrint;
  84.    PrintWin1.NewFont ('Arial',20,True,True,True);
  85.    PrintWin1.SetTheTextColor (RGB(255,0,0));
  86.    PrintWin1.DrawText( 1.2,poCenter,'The Customer');
  87.  
  88.    PrintWin1.NewFont ('Arial',18,False,False,False);
  89.    PrintWin1.SetTheTextColor (RGB(0,0,0));
  90.    PrintWin1.DrawWindow( 2.1,poCenter,ScrollBox);
  91.  
  92.  
  93.    y := 5.0;
  94.  
  95.    PrintWin1.SelectPen (2, RGB(255,0,0));
  96.  
  97.    PrintWin1.NewFont ('Arial',20,True,True,True);
  98.    PrintWin1.SetTheTextColor (RGB(255,0,0));
  99.    PrintWin1.DrawText( y,poCenter,'The Orders');
  100.  
  101.    PrintWin1.SetFrameStyle(frThinThick);
  102.  
  103.    PrintWin1.NewFont ('Arial',14,False,True,False);
  104.    PrintWin1.SetTheTextColor (RGB(0,0,0));
  105.    PrintWin1.DrawTable( 6.0,poCenter, Table2, True, False);
  106.  
  107.    PrintWin1.EndPrint;
  108. end;
  109.  
  110.  
  111. procedure TForm07.ExitClick(Sender: TObject);
  112. begin
  113.     Close;
  114. end;
  115.  
  116.  
  117. end.